public void play(AudioInputStream playbackInputStream) {
	AudioFormat format = playbackInputStream.getFormat();
	DataLine.Info info = new DataLine.Info(SourceDataLine.class, format);
	SourceDataLine line = (SourceDataLine) AudioSystem.getLine(info);
	line.open(format, bufSize);
	byte[] data = new byte[bufferLengthInBytes];
	int numBytesRead = 0;
	line.start();
	while (true) {
		if ((numBytesRead = playbackInputStream.read(data)) == -1) {
			break;
		}
		int numBytesRemaining = numBytesRead;
		while (numBytesRemaining > 0) {
			numBytesRemaining -= line.write(data, 0, numBytesRemaining);
		}
	}
	line.drain();
	line.stop();
	line.close();
}
